use "\\Client\H$\Dropbox\Replications_papers\PSRM\Replication_PSRM\Figure_4_5\xzd_0412_demographics.dta", clear
 probit yd log_income age schooling gender marriage unemployed
 predict phat

di"--------------------------"
di"  Figure 4                "
di"--------------------------"

 gen zb=_b[_cons]+_b[log_income]*log_income+_b[age]*age+_b[schooling]*schooling+ _b[gender]*gender+_b[marriage]*marriage+_b[unemployed]*unemployed
 twoway (scatter phat zb) if zb>-3
 
di"--------------------------"
di"  Figure 5                "
di"--------------------------"

	

twoway (histogram phat if yd==0,  color(green)) ///
      (histogram phat if yd==1, ///
	  fcolor(none) lcolor(black)), legend(order(1 "2004" 2 "2012" ))
	  

	  
 clear
